<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery.min.js"></script>
    <script>
      $(function () {
        /*var $div = $("#aaa");
        // alert($div.html());
        alert($div.length);*/

          var $div = $(".div1");
          alert($div.html());
          alert($div.length);
      })

      /*window.onload = function () {
          var div = document.getElementById("aaa");
          alert(div.innerHTML);
      }*/

    </script>
</head>
<body>
<div id="aaa" class="div1">在嘛</div>
<div id="bbb" class="div2">不在</div>
</body>
</html>